:root{
  --accent:#4f46e5;
  --muted:#6b7280;
  --bg:#0f172a;
  --card:#0b1220;
  --radius:10px;
  --gap:12px;
  --text:#e6eef8;
}

*{box-sizing:border-box}
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:linear-gradient(180deg,#06102a 0%, #071024 50%, #071028 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
}

.demo{
  width:100%;
  max-width:900px;
}

.title{
  font-size:1.4rem;
  margin:0 0 16px 0;
  color:var(--text);
  text-align:center;
}

.tabs{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:var(--radius);
  padding:16px;
  box-shadow: 0 6px 22px rgba(2,6,23,0.6);
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:var(--gap);
  align-items:start;
}

/* Visually hide inputs but keep them accessible/focusable */
input[type="radio"]{
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Style labels as tabs */
.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  background:transparent;
  color:var(--muted);
  border-radius:8px;
  cursor:pointer;
  user-select:none;
  transition: all 200ms ease;
  border:1px solid transparent;
  font-weight:600;
}

/* When the associated input is focused, style the label so keyboard users see it */
input[type="radio"]:focus + .tab,
.tab:focus{
  outline:3px solid rgba(79,70,229,0.18);
  outline-offset:2px;
}

/* Layout: labels across top and panels below on small screens */
@media (max-width:640px){
  .tabs{grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tab{ justify-content:flex-start; }
}

/* Panels style */
.panel{
  grid-column: 1 / -1; /* span full width */
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
  padding:18px;
  margin-top:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.03);
  color:var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

/* Default hidden panels; show the one matching the :checked sibling */
.panel{ display:none; }
#tab1:checked ~ #panel1{ display:block; }
#tab2:checked ~ #panel2{ display:block; }
#tab3:checked ~ #panel3{ display:block; }

/* Active tab visual: style label for the checked input */
#tab1:checked + label[for="tab1"],
#tab2:checked + label[for="tab2"],
#tab3:checked + label[for="tab3"]{
  color:var(--text);
  background: linear-gradient(90deg, rgba(79,70,229,0.12), rgba(79,70,229,0.06));
  border:1px solid rgba(79,70,229,0.2);
  box-shadow: 0 6px 18px rgba(15,23,42,0.6);
  transform: translateY(-4px);
}

/* Small enhancements */
.panel h2{ margin-top:0; color:var(--accent); }
.panel p, .panel ul{ color: #cbd5e1; line-height:1.45; }